package cn.yunhe.model;

import javax.persistence.*;
import java.io.Serializable;

/*hibernate注解s213*/
@Entity(name = "House1")
@Table(name = "house")
/*@Table(name = "houses")*/
public class House implements  Serializable {
    private Integer hid;
    private String htitle;
    private Double hprice;
    private Double hfloorage;
    private String hpubdate;
    private String hcontact;
    private String hdesc;
    private Integer hflag;

    private Member member;
    private Type type;
    private Street street;

    public House() {
    }

    public House(String htitle, Double hprice, Double hfloorage, String hpubdate, String hcontact, String hdesc, Integer hflag, Member member, Type type, Street street) {
        this.htitle = htitle;
        this.hprice = hprice;
        this.hfloorage = hfloorage;
        this.hpubdate = hpubdate;
        this.hcontact = hcontact;
        this.hdesc = hdesc;
        this.hflag = hflag;
        this.member = member;
        this.type = type;
        this.street = street;
    }

    public House(Integer hid, String htitle, Double hprice, Double hfloorage, String hpubdate, String hcontact, String hdesc, Integer hflag, Member member, Type type, Street street) {
        this.hid = hid;
        this.htitle = htitle;
        this.hprice = hprice;
        this.hfloorage = hfloorage;
        this.hpubdate = hpubdate;
        this.hcontact = hcontact;
        this.hdesc = hdesc;
        this.hflag = hflag;
        this.member = member;
        this.type = type;
        this.street = street;
    }

    @Id
    @GeneratedValue
    @Column(name = "hid")
    public Integer getHid() {
        return hid;
    }

    public void setHid(Integer hid) {
        this.hid = hid;
    }

    @Column(name = "htitle")
    public String getHtitle() {
        return htitle;
    }

    public void setHtitle(String htitle) {
        this.htitle = htitle;
    }

    @Column(name = "hprice")
    public Double getHprice() {
        return hprice;
    }

    public void setHprice(Double hprice) {
        this.hprice = hprice;
    }

    @Column(name = "hfloorage")
    public Double getHfloorage() {
        return hfloorage;
    }

    public void setHfloorage(Double hfloorage) {
        this.hfloorage = hfloorage;
    }

    @Column(name = "hpubdate")
    public String getHpubdate() {
        return hpubdate;
    }

    public void setHpubdate(String hpubdate) {
        this.hpubdate = hpubdate;
    }

    @Column(name = "hcontact")
    public String getHcontact() {
        return hcontact;
    }

    public void setHcontact(String hcontact) {
        this.hcontact = hcontact;
    }

    @Column(name = "hdesc")
    public String getHdesc() {
        return hdesc;
    }

    public void setHdesc(String hdesc) {
        this.hdesc = hdesc;
    }

    @Column(name = "hflag")
    public Integer getHflag() {
        return hflag;
    }

    public void setHflag(Integer hflag) {
        this.hflag = hflag;
    }

    @ManyToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "hmid")
    public Member getMember() {
        return member;
    }

    public void setMember(Member member) {
        this.member = member;
    }

    @ManyToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "htid")
    public Type getType() {
        return type;
    }

    public void setType(Type type) {
        this.type = type;
    }

    @ManyToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "hsid")
    public Street getStreet() {
        return street;
    }

    public void setStreet(Street street) {
        this.street = street;
    }
}
